<?php
session_start();
isset($_SESSION['randomregister']) or die ("Access denided");
$strtext = $_SESSION['randomregister'];
// create a 100*30 image
$im = imagecreate(65, 20);

// white background and blue text
$bg = imagecolorallocate($im, 160, 0, 0);
$textcolor = imagecolorallocate($im, 255, 255, 255);

// write the string at the top left
imagestring($im, 5, 5, 2, $strtext, $textcolor);

// output the image
header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im);
?> 